#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

const int maxn = 30 + 1;
int m[maxn][maxn] = {0};
int n;

int main()
{
	freopen("weight.in","r",stdin);
	freopen("weight.out","w",stdout);

	while(1)
	{
		cin >> n;
		if(n == 0)
            break;
		for(int i = 1; i <= n; i ++)
			for(int j = i + 1; j <= n; j ++)
			{
				cin >> m[i][j];
				m[j][i] = m[i][j];
			}
        int s = 0;
        for(int i = 1; i < n - 1; i ++)
        {
            int d = 0x7fffffff;
            for(int j = i + 1; j < n; j ++)
            {
                d = min((m[i][j] + m[i][n] - m[j][n]) / 2, d);
            }
            s += d;
        }
        s += m[n-1][n];
        cout << s << endl;
	}

	return 0;
}
